<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>parse_generate_options (Spec::Runner::Options)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File vendor\plugins\rspec/lib/spec/runner/options.rb, line 134</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_generate_options</span>(<span class="ruby-identifier">options_file</span>, <span class="ruby-identifier">args_copy</span>, <span class="ruby-identifier">out_stream</span>)
        <span class="ruby-comment cmt"># Remove the --generate-options option and the argument before writing to file</span>
        <span class="ruby-identifier">index</span> = <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">&quot;-G&quot;</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">&quot;--generate-options&quot;</span>)
        <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">index</span>)
        <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">index</span>)
        <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">options_file</span>, <span class="ruby-value str">'w'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">args_copy</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
        <span class="ruby-keyword kw">end</span>
        <span class="ruby-identifier">out_stream</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\nOptions written to #{options_file}. You can now use these options with:&quot;</span>
        <span class="ruby-identifier">out_stream</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;spec --options #{options_file}&quot;</span>
        <span class="ruby-ivar">@generate</span> = <span class="ruby-keyword kw">true</span>
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>